using UniversalAdmin.Application.DTOs;
using UniversalAdmin.Domain.Entities;
using UniversalAdmin.Shared.Enums;

namespace UniversalAdmin.Application.Services;

public interface IDocumentPermissionService
{
    Task<DocumentPermissionDto> CreatePermissionAsync(CreateDocumentPermissionDto dto);
    Task<bool> DeletePermissionAsync(Guid id);
    Task<bool> UpdatePermissionAsync(Guid id, UpdateDocumentPermissionDto dto);
    Task<DocumentPermissionDto?> GetPermissionByIdAsync(Guid id);
    Task<IEnumerable<DocumentPermissionDto>> GetPermissionsByDocumentIdAsync(Guid documentId);
    Task<IEnumerable<DocumentPermissionDto>> GetPermissionsByUserIdAsync(Guid userId);
    Task<IEnumerable<DocumentPermissionDto>> GetPermissionsByRoleIdAsync(Guid roleId);
    Task<bool> CheckPermissionAsync(Guid documentId, Guid userId, PermissionType requiredPermission);
    Task<IEnumerable<Guid>> GetAccessibleDocumentIdsAsync(Guid userId, PermissionType requiredPermission);
    Task DeletePermissionsByDocumentIdAsync(Guid documentId);
}